/*
 * Copyright (c) 2005-2007 FeaySoft Inc. All Rights Reserved.
 */
package com.feyaSoft.plugin.util.mail;

import java.util.Properties;

import org.springframework.mail.MailSender;
import org.springframework.mail.javamail.JavaMailSenderImpl;

import com.feyaSoft.plugin.base.FeyaSoftKey;

/**
 * @author Fenqiang Zhuang
 * 
 */
public class JavaMailSimpleMailSender extends SimpleMailSender {

	protected MailSender getMailSender() {
		JavaMailSenderImpl sender = new JavaMailSenderImpl();

		// set outgoing email server
		sender.setHost(FeyaSoftKey.MAIL_SERVER_HOST);
		sender.setUsername(FeyaSoftKey.MAIL_SERVER_USERNAME);
		sender.setPassword(FeyaSoftKey.MAIL_SERVER_PW);

		Properties authProp = new Properties();
		authProp.setProperty("mail.smtp.auth", "true");
		sender.setJavaMailProperties(authProp);

		return sender;
	}

}
